package com.chainyoung.component_tmperson.ui.mvp.presenter;

import com.chainyoung.common.appcommon.entity.HdWalletCache;
import com.chainyoung.common.base.CommonSubscriber;
import com.chainyoung.common.mvp.BasePresenter;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmperson.ui.mvp.contract.SelectHdWalletListContract;
import com.chainyoung.component_tmperson.ui.mvp.contract.WalletLocalContract;

import java.util.List;

import javax.inject.Inject;

public class SelectHdWalletListPresenter  extends BasePresenter<SelectHdWalletListContract.Model, SelectHdWalletListContract.View> {


    @Inject
    public SelectHdWalletListPresenter(SelectHdWalletListContract.Model model, SelectHdWalletListContract.View rootView) {
        super(model, rootView);
    }





    public void getAllHdWalletCaches(String coinType) {
        addSubscribe(mModel.getAllHdWalletCaches(coinType)
                .compose(RxUtils.<List<HdWalletCache>>rxSchedulerHelper())
                .subscribeWith(new CommonSubscriber<List<HdWalletCache>>(mView) {
                    @Override
                    public void onNext(List<HdWalletCache> data) {
                        mView.onGetAllHdWalletCaches(data);
                    }

                    @Override
                    public void onError(Throwable e) {
                        super.onError(e);
                    }
                }));


    }









}


